package controllers

import (
	service "go_hw/services"
	"fmt"
	_ "github.com/go-sql-driver/mysql"
)

//private String result = "OK";
//List<T> list;
//Integer total;
type ClazzVue struct{
	Total int `json:"total"`
	Result string `json:"result"`
	List []service.ClazzVO `json:"list"`
}


type ClazzController struct {
	BaseController
}
// @Title Get
// @Description 获取列表数据
// @Param	pos		query 	int32	true		"下标 从0开始"
// @Param	rows		query 	int32	true		"行数 > 0"
// @Success 200 {object} controllers.ClazzVue
// @Failure 403 :uid is empty
// @router / [get]
func (c *ClazzController) Get() {
	// 获取 URL地址的值
	var pos int
	c.Ctx.Input.Bind (&pos,"pos")
	var rows int
	c.Ctx.Input.Bind(&rows,"rows")
	vue := ClazzVue{}
	vue.Total = int(service.CountClazzAll())
	vue.Result = "OK"
	vue.List = service.FindClazzVO(pos,rows)
	c.Data["json"] = vue
	c.ServeJSON()
}
func (c *ClazzController) Post() {

	fmt.Printf("dddd")
}

func (c *ClazzController) Put() {

}

func (c *ClazzController) Delete() {

}
